package com.game.src.main;

import java.awt.Graphics;
import java.util.Random;

public class Meteor {

	private double x, y;
	private double vx;
	private double vy;
	Random r = new Random();
	
	private Textures tex;
	
	private int health;
	private int damage = 10;
	
	
	
	public Meteor(double x, double y, int health, Textures tex, boolean straigth) {
		this.x = x;
		this.y = y;
		this.tex = tex;
		this.vy = r.nextInt(20)/10.0+1;
		this.vx = r.nextInt(10)/10.0;
		this.health = health;
		
		if(straigth) vx = 0;
	}
	

	public void tick() {
		y += vy;
		x += vx;

	}

	public void render(Graphics g) {
		g.drawImage(tex.meteor, (int) x, (int) y, null);
	}
	
	public double getY(){
		return y;
	}
	
	public double getX(){
		return x;
	}


	/**
	 * @return the health
	 */
	public int getHealth() {
		return health;
	}


	/**
	 * @param health the health to set
	 */
	public void setHealth(int health) {
		this.health = health;
	}


	/**
	 * @return the damage
	 */
	public int getDamage() {
		return damage;
	}


	/**
	 * @param damage the damage to set
	 */
	public void setDamage(int damage) {
		this.damage = damage;
	}
}
